package com.xuef.service.impl;

import com.xuef.entity.Role;
import com.xuef.repository.RoleRepository;
import com.xuef.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by moveb on 2018/5/20.
 */
@Service
public class RoleServiceImpl implements IRoleService {
    @Autowired
    private RoleRepository roleRepository;

    @Override
    public List<Role> findByUserId(Integer userId) {
        return roleRepository.findByUserId(userId);
    }

    @Override
    public void save(Role role) {
        roleRepository.save(role);
    }
}
